<!-- extend from base layout -->
{% extends "layout.html" %}

{% block content %}
    <div class="container">
    <h2 class="sub-header">Blog Edit</h2>
    <form class="form-horizontal" method="post" action="">
        {{ form.csrf_token }}
        <div class="form-group{% if form.author.errors %} has-error{% endif %}">
            {{ form.author.label(class="col-sm-2 control-label") }}
            <div class="col-sm-10">
                {{ form.author(class="form-control", placeholder="Author") }}
                {% for error in form.author.errors %}
                    <span class="help-block">{{ error }}</span>
                {% endfor %}
            </div>
        </div>
        <div class="form-group{% if form.title.errors %} has-error{% endif %}">
            {{ form.title.label(class="col-sm-2 control-label") }}
            <div class="col-sm-10">
                {{ form.title(class="form-control", placeholder="Title") }}
                {% for error in form.title.errors %}
                    <span class="help-block">{{ error }}</span>
                {% endfor %}
            </div>
        </div>
        <div class="form-group{% if form.pub_date.errors %} has-error{% endif %}">
            {{ form.pub_date.label(class="col-sm-2 control-label") }}
            <div class="col-sm-10">
                {{ form.pub_date(class="form-control", placeholder="Pub Date", type='date') }}
                {% for error in form.pub_date.errors %}
                    <span class="help-block">{{ error }}</span>
                {% endfor %}
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default btn-load" data-loading-text="Edit...">Edit</button>
                <button type="reset" class="btn btn-default">Reset</button>
                <button class="btn btn-default" onclick="history.back();">Back</button>
            </div>
        </div>
    </form>
    </div>
{% endblock %}